package ar.com.vates.arrays;

import java.util.ArrayList;
import java.util.Collections;

public class Ejercicio {

	public static void main(String[] args) {

		/*
		 * String[] concursantes = new String[] { "Carlos", "Marisa", "Raul",
		 * "Miguel", "Lautaro", "Romina", "Cesar", "Monica", "Ramon", "Facundo"
		 * };
		 * 
		 * for (int i = 0; i < concursantes.length; i++) {
		 * System.out.println("Participante " + (i+1) + ": " + concursantes[i]);
		 * }
		 * 
		 * int x1 = (int) (Math.random() * 10);
		 * 
		 * int x2; do { x2 = (int) (Math.random() * 10); } while (x2 == x1);
		 * 
		 * int x3 = 0; do { x3 = (int) (Math.random() * 10); } while (x3 == x1
		 * || x3 == x2);
		 * 
		 * 
		 * System.out.println("\n============GANADORES============");
		 * 
		 * System.out.println("1er premio es para: " + concursantes[x1] + " (" +
		 * (x1 + 1) + ")"); System.out.println("2do premio es para: " +
		 * concursantes[x2] + " (" + (x2 + 1) + ")");
		 * System.out.println("3er premio es para: " + concursantes[x3] + " (" +
		 * (x3 + 1) + ")");
		 */

		String[] jugadores = { "AAA", "BBB", "CCC", "DDD", "EEE", "FFF", "GGG",
				"HHH", "III", "JJJ", "KKK", "LLL", "MMM", "NNN", "OOO", "PPP" };

		// Lleno el ArrayList con los indices
		ArrayList<Integer> aux = new ArrayList<Integer>();
		for (int i = 0; i < jugadores.length; i++) {
			aux.add(i);
		}

		// Mezclo todos los indices
		Collections.shuffle(aux);

		System.out.println("Primer premio: " + jugadores[aux.get(0)]);
		System.out.println("Segundo premio: " + jugadores[aux.get(1)]);
		System.out.println("Tercer premio: " + jugadores[aux.get(2)]);
	}
}